# -*- coding: cp1251 -*-
from chess import *

class checkChess():
    def test(self, width, height, figures):
        brd = board(width, height)

        brd.fList = []
        for f in figures.split(','):
            if (f.lower() == 'king'):
                brd.fList.append(king())
            elif(f.lower() == 'queen'):
                brd.fList.append(queen())
            elif(f.lower() == 'pawn'):
                brd.fList.append(pawn())
            elif(f.lower() == 'rook'):
                brd.fList.append(rook())
            elif(f.lower() == 'bishop'):
                brd.fList.append(bishop())
            elif(f.lower == 'horse'):
                brd.fList.append(horse())
            else:
                print "Wrong chessman name:",f.lower()

        brd.place()
        brd.printChessmen()
        print "is correct:",brd.isCorrect()
        
if __name__=="__main__":
    checkChess().test(3, 3, "rook,rook,bishop")
    #checkChess().test(4, 4, "queen,queen,queen")
    checkChess().test(4, 4, "queen,queen,queen,queen")
